#!/usr/bin/env python
import time
import asyncio
from websockets.sync.client import connect


def hello():
    with connect("ws://localhost:8899") as websocket:
        websocket.send("Hello world!")
        message = websocket.recv()
        print(f"Received: {message}")

        while True:
            send = input("Enter:")
            websocket.send(send)
            websocket.send(f"2st {time.time()} {send}")
            recv = websocket.recv()
            print(f"> {recv}")
            recv = websocket.recv()
            print(f">> {recv}")

hello()
